import { connect } from 'react-redux';
import { LoginAction } from './action';
import { LoginActionType } from './const';
import Login from './component/Login';

const { loginInfo } = LoginActionType.key;
const mapStateToProps = (state) => {
  const { loginState } = state;
  return {
    loginInfo: loginState.get(loginInfo),
  };
};

const mapDispatchToProps = {
  /** 执行登录 */
  doLogin: LoginAction.doLogin,
};

export default connect(mapStateToProps, mapDispatchToProps)(Login);

